package com.dev.shiro.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * 
 * @author admin
 * @date 2022-03-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user_online")
@ApiModel("")
public class UserOnline extends Model<UserOnline> {

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    @ApiModelProperty(value = "",required = false)
    @TableId(value = "session_id", type = IdType.INPUT)
    private String sessionId;

    /**
     * 
     */
    @ApiModelProperty(value = "",required = false)
    private String loginName;

    /**
     * 
     */
    @ApiModelProperty(value = "",required = false)
    private String loginLocation;

    /**
     * 
     */
    @ApiModelProperty(value = "",required = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sessionCreateTime;

    /**
     * 
     */
    @ApiModelProperty(value = "",required = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastAccessTime;

    /**
     * 
     */
    @ApiModelProperty(value = "",required = false)
    private Integer expireTime;

    /**
     * 
     */
    @ApiModelProperty(value = "",required = false)
    private Integer status;

    @Override
    protected Serializable pkVal(){
        return this.sessionId;
    }
}
